package chenji.gunapi.antiCheat;

import java.util.HashMap;
import java.util.Map.Entry;

import org.bukkit.entity.Player;

import chenji.gunapi.GunAPI;
import chenji.gunapi.task.Taskable;

public class PlayerPackageProtecter implements Taskable {
	private HashMap<Player, Integer> amount = new HashMap<Player, Integer>();
	private HashMap<Player, Integer> violateamount = new HashMap<Player, Integer>();

	public PlayerPackageProtecter() {
		GunAPI.getGunAPI().getGunTaskManager().registerPerSecondTask(this);
	}

	public void onPlayerPackageReceive(Player p) {
		if (this.amount.containsKey(p)) {
			this.amount.put(p, this.amount.get(p) + 1);
		} else {
			this.amount.put(p, 1);
		}

	}

	public void reportviolate(Player p) {	
		if(this.violateamount.containsKey(p)){
			
		}
	}

	@Override
	public void task() {
		for (Entry<Player, Integer> enter : this.amount.entrySet()) {
			if (enter.getValue() >= 40) {
				this.reportviolate(enter.getKey());
			}
		}
	}

}
